Java Enterprise Edition Support in Search-Based JUnit Test Generation
نویسندگان
چکیده
Many different techniques and tools for automated unit test generation target the Java programming languages due to its popularity. However, a lot of Java’s popularity is due to its usage to develop enterprise applications with frameworks such as Java Enterprise Edition (JEE) or Spring. These frameworks pose challenges to the automatic generation of JUnit tests. In particular, code units (“beans”) are handled by external web containers (e.g., WildFly and GlassFish). Without considering how web containers initialize these beans, automatically generated unit tests would not represent valid scenarios and would be of little use. For example, common issues of bean initialization are dependency injection, database connection, and JNDI bean lookup. In this paper, we extend the EvoSuite search-based JUnit test generation tool to provide initial support for JEE applications. Experiments on 247 classes (the JBoss EAP tutorial examples) reveal an increase in code coverage, and demonstrate that our techniques prevent the generation of useless tests (e.g., tests where dependencies are not injected).
منابع مشابه
Writing Self-testing Java Classes with SelfTest
This document provides a tutorial introduction to Java annotations called SelfTest. The SelfTest annotations allow one to annotate Java classes with test data, and the SelfTest annotation processor generates executable JUnit test classes from annotated Java classes by translating test cases to executable JUnit tests. The SelfTest annotations not only automate unit testing of Java classes signif...
متن کاملAn Informal Formal Method for Systematic JUnit Test Case Generation
The JUnit testing tool is widely used to support the central XP concept of test first software development. While JUnit provides Java classes for expressing test cases and test suites, it does not provide or proscribe per se any guidelines for deciding what test cases are good ones for any particular class. We have developed a method for systematically creating complete and consistent test cl...
متن کاملTest-Driven Web Application Development in Java
Today, software availability as well as adaptability has a strong impact on application development. Together with the success of the Internet technology, it is often necessary to offer a web-based software solution. For Java development, J2EE builds a bridge from traditional towards web application development. Java Server Pages and Servlets allow the implementation of web sites with dynamic c...
متن کاملAn Early Testing and Defense Web Application Framework for Malicious Input Attacks
We introduce a Java Web Application Reliability and Defense (WARD) framework, a two-part security solution composed of a vulnerability detection component, SecureUnit, and a vulnerability protection component, SecureFilter. SecureUnit enables developers to write automated, reusable, and customizable JUnit tests that launch attacks on their systems to reveal security vulnerabilities. SecureFilte...
متن کاملSpecification-Driven Unit Test Generation for Java Generic Classes
Several approaches exist to automatically derive test cases that check the conformance of the implementation of abstract data types (ADTs) with respect to their specification. However, they lack support for the testing of implementations of ADTs defined by generic classes. In this paper, we present a novel technique to automatically derive, from specifications, unit test cases for Java generic ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2016